package uiLayer;

import modelLayer.OrderLine;
import uiUtil.AbstractCustomTable;

public class OrderLineTable extends AbstractCustomTable<OrderLine> {

	public OrderLineTable() {
		
		super();
		super.setColNames("Varenr.", "Navn", "Pris", "Farve", "Størrelse", "Antal");
		
	}
	
	@Override
	public Object getCellValue(int col, OrderLine o) {
		
		Object res = null;
		switch (col) {
			case 0:
				res = o.getProduct().getProductID();
				break;
			case 1:
				res = o.getProduct().getName();
				break;
			case 2: 
				res = o.getProduct().getSalesPrice();
				break;
			case 3:
				res = o.getProduct().getColour();
				break;
			case 4:
				res = o.getProduct().getSize();
				break;
			case 5:
				res = o.getAmount();
				break;
		}
		return res;
		
	}

}
